package com.yiyuan.app.controller;

import com.guaike.core.entity.result.Result;
import com.yiyuan.app.entity.param.RankDTO;
import com.yiyuan.app.entity.result.RankVO;
import com.yiyuan.app.service.MRankPinecutService;
import com.yiyuan.app.service.RankService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rank")
@Api(tags = "排行榜相关接口组")
@AllArgsConstructor
public class RankController {

    private final RankService rankService;
    private final MRankPinecutService mRankPinecutService;

    @GetMapping("/pinecone/list")
    @ApiOperation(value = "松果排行榜列表")
    public Result<RankVO> pineconeRankList(RankDTO param) {
        return rankService.pineconeRankList(param);
    }

    @GetMapping("/rich/list")
    @ApiOperation(value = "壕气排行榜列表")
    public Result<RankVO> richRankList(RankDTO param) {
        return rankService.richRankList(param);
    }

    @GetMapping("/pushCoins/list")
    @ApiOperation(value = "推币高手排行榜列表")
    public Result<RankVO> pushCoinsRankList(RankDTO param) {
        return rankService.pushCoinsRankList(param);
    }

    @GetMapping("/arcadeMachine/list")
    @ApiOperation(value = "潮玩达人排行榜列表")
    public Result<RankVO> arcadeMachineRankList(RankDTO param) {
        return rankService.arcadeMachineRankList(param);
    }


    @GetMapping("/pinecut/list")
    @ApiOperation(value = "彩票排行榜列表")
    public Result<RankVO> pinecutRankList(@ApiParam("榜单类型(daily:日榜, week:周榜, pre_daily: 上周榜)") @RequestParam("rankType") String rankType) {
        return mRankPinecutService.pinecutRankList(rankType);
    }
}
